<div class="box box-info">
    <div class="box-header with-border">
        <h3 class="box-title">广告位名称：{$space.name}</h3>
        <a href="javascript:history.back(-1)" title="返回广告版位列表"><i class="fa fa-fw fa-reply-all"></i></a>
        <div class="box-tools pull-right">
            <a href="{:url('poster/editposter',['spaceid'=>$space['id']])}" class="btn btn-sm btn-info btn-flat"><i class="fa fa-fw fa-user-plus"></i> 添加广告</a>
        </div>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <div class="table-responsive">
            <table class="table no-margin">
                <thead>
                    <tr>
                        <th width='7%'>排序</th>
                        <th>ID</th>
                        <th>广告标题</th>
                        <th>广告类型</th>
                        <th>所属版位</th>
                        <th>状态</th>
                        <!--th>点击数</th-->
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <!--th>添加时间</th-->
                        <th>管理操作</th>
                    </tr>
                </thead>
                <tbody>
                    {volist name="list" id="data"}
                    <tr>
                        <td width='7%'><input type='number' class='form-control list_order' data-id='{$data.id}' value='{$data.list_order}'  /></td>
                        <td>{$data.id}</td>
                        <td>{$data.name}</td>
                        <td>{$posterType[$data['type']]}</td>
                        <td>{$space.name}</td>
                        <td>{$posterStatus[$data['status']]}</td>
                        <td>{if($data['startdate'])}{:date('Y-m-d',$data['startdate'])}{else/}---{/if}</td>
                        <td>{if($data['enddate'])}{:date('Y-m-d',$data['enddate'])}{else/}---{/if}</td>
                        <!--td>{:date('Y-m-d H:i',$data['addtime'])}</td-->
                        <td>
                            <a href="{:url('poster/editposter',['spaceid'=>$space['id'],'id'=>$data['id']])}" class="btn btn-link">修改</a>
                            |
                            <a href="#" class="btn btn-link" onclick='delSpace({$data.id}, "{$data.name}")'>删除</a>
                        </td>
                    </tr>
                    {/volist}
                    <tr>
                        <td width='7%'>
                            <button class="btn btn-info" onclick='setOrder("{:url('poster/setOrder')}")'>排序</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    /**
     * 删除广告位
     */
    function delSpace(id, name) {
        var _url = '{:url("poster/delPoster")}';
        url = _url + '?id=' + id;
        confirmDelDefault(url, "该操作不能恢复，请谨慎操作！");
    }
</script>